package com.example.leepong.Game.Presets;

import com.example.leepong.Game.Entities.PlayerProfile;
import com.example.leepong.Game.Entities.Shot;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * Created by Ichigo on 24/05/2014.
 */
public class PlayerProfileStore {

    private PlayerProfileStore inst = new PlayerProfileStore();

    public static final int FEDERER = 1;
    public static final int NADAL = 2;
    public static final int DJOCKOVIC = 3;
    public static final int IMPREVISIBLE_MAN = 4;
    public static final int PONG = 5;


    public static final float ReferenceMoveSpeed = 0.5f;
    public static final float ReferenceRecenterSpeed = 0.3f;
    public static final float ReferencePower = 0.4f;
    public static final float ReferenceWidthRatio = 1 / 3.5f;
    public static final float ReferenceHeightRatio = 1 / 7f;

    private PlayerProfileStore() {

    }

    public static PlayerProfile GetProfile(int playerId) {
        PlayerProfile p = new PlayerProfile();
        if (playerId == FEDERER) {

            p.MoveSpeed = ReferenceMoveSpeed * 0.80f;
            p.RecenterSpeed = ReferenceRecenterSpeed * 0.90f;
            p.Power = ReferencePower * 0.95f;
            p.HeightRatio = ReferenceHeightRatio * 1.1f;
            p.WidthRatio = ReferenceWidthRatio;
            p.ShotSelection = new ArrayList<Shot>(
                    Arrays.asList(
                            Shot.Reflect, Shot.Reflect,
                            Shot.Cross, Shot.Cross,
                            Shot.Counter,
                            Shot.Long
                    )
            );

        } else if (playerId == NADAL) {
            p.MoveSpeed = ReferenceMoveSpeed * 0.80f;
            p.RecenterSpeed = ReferenceRecenterSpeed * 0.90f;
            p.Power = ReferencePower * 0.95f;
            p.HeightRatio = ReferenceHeightRatio;
            p.WidthRatio = ReferenceWidthRatio;
            p.ShotSelection = new ArrayList<Shot>(
                    Arrays.asList(
                            Shot.Reflect, Shot.Reflect,
                            Shot.Cross, Shot.Cross, Shot.Cross,
                            Shot.Counter,
                            Shot.Long
                    )
            );
        } else {
            return null;
        }

        return p;
    }
}
